<include file="Finance:leftmenu" />
<div class="content-right fl">
	<form action="" id="form" method="POST">
       
		<div class="formitems">  
			<label class="fi-name"><span class="colorRed">*</span>会员手机号/姓名：</label>
			<div class="form-controls">
				<input type="text" id="mobileNumber" class="input xlarge" name="mobile" autocomplete="off">
				<div class="matchs fi-help-text" style="width:400px;position:absolute;z-index:999999"></div>
			</div>
			
		</div>

	</form>
	
	
	    <table class="wxtables">
         	<colgroup>
         		<col width="3%">
               <col width="5%">
               <col width="6%">
               <col width="9%">
            </colgroup>
            <thead>
            <tr>
                <td>编号</td>
                <td>姓名</td>
                <td>手机号</td>
                <td>账户</td>
            </tr>
            </thead>
            <tbody id="trAccount">
			
				<volist name="datalist" id="vo">
				<tr>
				<td>{$vo.uid}</td>
                <td><a style="color:blue;" target="_blank" href="/admin/member/index?user_id=<?php echo $vo['uid'];?>">{$vo.realname}</a></td>
                <td>{$vo.mobile}</td>
                <td>
                	可用佣金:<a style="color:blue;" target="_blank" href="/admin/finance/liushui?user_id=<?=$vo[uid]?>"><?php echo $vo['money'];?></a><br>
               		已提现: <a style="color:blue;" target="_blank" href="/admin/finance/index?uid=<?=$vo[uid]?>"><?php echo $vo['tixian'];?></a><br>
              		电子币账户: <a style="color:blue;" target="_blank" href="/admin/finance/cash?user_id=<?=$vo[uid]?>"><?php echo $vo['cash_money'];?></a><br>		
              		锁定佣金: <?php echo $vo['lock_money'];?><br> 	
                </td>

				</tr>
				</volist>
				
			</tbody>
        </table>
        	<div class="pageNum tables-btmctrl clearfix">
			   <div class="mgt10">
				   <div class="paginate">
					  {$page}
				   </div>
			   </div>
			</div>
        
        
</div>
<script>
//根据手机号码/姓名匹配用户
$("#mobileNumber").keyup(function(){
	var str = $(this).val();
	var self = $(this);
	var dom = $(".matchs");
	if(str){
		$.ajax({
			url:"/admin/common/matchmember",
			type:"post",
			data:{str:str},
			dataType:"json",
			success:function(data){
				//console.log(data);
				var memberJson = {};
				dom.html("");
				$.each(data,function(){
					//memberAccount = data;
					memberJson[this.uid] = this;
					var html = '<div class="match" data-uid='+this.uid+'  style="padding:5px 20px;background-color:#D3D3D3;border-bottom:2px solid white;" >姓名：'+this.realname+' 手机号码：'+this.mobile+'</div>';
					dom.append(html);
				});
				$(".match").on("click",function(){
					$(".pageNum").html('');
					var uid = $(this).attr('data-uid');
					var memberAccount = memberJson[uid];
					var mobile = memberAccount.mobile;					
					self.val(mobile);
					 
					var html =	"<tr style='background-color:pink'>"+
									"<td>"+memberAccount.uid+"</td>"+
					                "<td>"+memberAccount.realname+"</td>"+
					               " <td>"+memberAccount.mobile+"</td>"+
					                "<td>"+
					                '可用佣金:<a style="color:blue;" target="_blank" href="/admin/finance/liushui?user_id='+memberAccount.uid+'">'+memberAccount.money+'</a> <br>'+
				               		'已提现: <a style="color:blue;" target="_blank" href="/admin/finance/index?uid='+memberAccount.uid+'">'+memberAccount.tixian+'</a><br>'+
				              		'电子币账户: <a style="color:blue;" target="_blank" href="/admin/finance/cash?user_id='+memberAccount.uid+'">'+memberAccount.cash_money+'</a><br>'+
				              		'锁定佣金: '+memberAccount.lock_money+'<br> '+	
					                "</td>"+   
								"</tr>";
								
					$("#trAccount").prepend(html);
					self.val('');
					dom.html("");
				});
			},
			error:function(){
				dom.html("");
			}
		});
	}else{
		dom.html("");
	}
});


</script>